<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/include/lwip/etharp.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('lwip_2etharp_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">etharp.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pbuf_8h.html">lwip/pbuf.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip4__addr_8h.html">lwip/ip4_addr.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="netif_8h.html">lwip/netif.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip4_8h.html">lwip/ip4.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="lwip_2prot_2ethernet_8h.html">lwip/prot/ethernet.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="lwip_2prot_2etharp_8h.html">lwip/prot/etharp.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structetharp__q__entry.html">etharp_q_entry</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aaa3d8ed1eb1129f518345e37b38cfc37"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#aaa3d8ed1eb1129f518345e37b38cfc37">ARP_TMR_INTERVAL</a>&#160;&#160;&#160;1000</td></tr>
<tr class="separator:aaa3d8ed1eb1129f518345e37b38cfc37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83947dea159baf3420922084072e631e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a83947dea159baf3420922084072e631e">etharp_gratuitous</a>(<a class="el" href="structnetif.html">netif</a>)&#160;&#160;&#160;<a class="el" href="lwip_2etharp_8h.html#a3e56faced96841e615f88dd57d1b2b15">etharp_request</a>((<a class="el" href="structnetif.html">netif</a>), <a class="el" href="group__netif__ip4.html#gac9b6e63b5dd2968fe0a4813f3eefb55d">netif_ip4_addr</a>(<a class="el" href="structnetif.html">netif</a>))</td></tr>
<tr class="separator:a83947dea159baf3420922084072e631e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a654f4dad71f7e2bc4820094648f37a26"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a654f4dad71f7e2bc4820094648f37a26">etharp_tmr</a> (void)</td></tr>
<tr class="separator:a654f4dad71f7e2bc4820094648f37a26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f8ca87c5472fa165763c8c38b76174c"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a0f8ca87c5472fa165763c8c38b76174c">etharp_find_addr</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *ipaddr, struct <a class="el" href="structeth__addr.html">eth_addr</a> **eth_ret, const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> **ip_ret)</td></tr>
<tr class="separator:a0f8ca87c5472fa165763c8c38b76174c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab93df7ccb26496100d45137541e863c8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#ab93df7ccb26496100d45137541e863c8">etharp_get_entry</a> (size_t i, <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> **ipaddr, struct <a class="el" href="structnetif.html">netif</a> **<a class="el" href="structnetif.html">netif</a>, struct <a class="el" href="structeth__addr.html">eth_addr</a> **eth_ret)</td></tr>
<tr class="separator:ab93df7ccb26496100d45137541e863c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19258c75a3778b6ed0c82f63a419502d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a19258c75a3778b6ed0c82f63a419502d">etharp_output</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, struct <a class="el" href="structpbuf.html">pbuf</a> *q, const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *ipaddr)</td></tr>
<tr class="separator:a19258c75a3778b6ed0c82f63a419502d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae180772e31346a0afeb707ad172dd19c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#ae180772e31346a0afeb707ad172dd19c">etharp_query</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *ipaddr, struct <a class="el" href="structpbuf.html">pbuf</a> *q)</td></tr>
<tr class="separator:ae180772e31346a0afeb707ad172dd19c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e56faced96841e615f88dd57d1b2b15"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a3e56faced96841e615f88dd57d1b2b15">etharp_request</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>, const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *ipaddr)</td></tr>
<tr class="separator:a3e56faced96841e615f88dd57d1b2b15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae94677a2a5f3698276027c7475f6ca05"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#ae94677a2a5f3698276027c7475f6ca05">etharp_cleanup_netif</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:ae94677a2a5f3698276027c7475f6ca05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a540a5506979693ef9ac4496db9bfa7d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lwip_2etharp_8h.html#a540a5506979693ef9ac4496db9bfa7d6">etharp_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr>
<tr class="separator:a540a5506979693ef9ac4496db9bfa7d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Ethernet output function - handles OUTGOING ethernet level traffic, implements ARP resolving. To be used in most low-level netif implementations </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aaa3d8ed1eb1129f518345e37b38cfc37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa3d8ed1eb1129f518345e37b38cfc37">&#9670;&nbsp;</a></span>ARP_TMR_INTERVAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ARP_TMR_INTERVAL&#160;&#160;&#160;1000</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>1 seconds period </p>

</div>
</div>
<a id="a83947dea159baf3420922084072e631e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83947dea159baf3420922084072e631e">&#9670;&nbsp;</a></span>etharp_gratuitous</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define etharp_gratuitous</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><a class="el" href="structnetif.html">netif</a></td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="lwip_2etharp_8h.html#a3e56faced96841e615f88dd57d1b2b15">etharp_request</a>((<a class="el" href="structnetif.html">netif</a>), <a class="el" href="group__netif__ip4.html#gac9b6e63b5dd2968fe0a4813f3eefb55d">netif_ip4_addr</a>(<a class="el" href="structnetif.html">netif</a>))</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>For Ethernet network interfaces, we might want to send "gratuitous ARP"; this is an ARP packet sent by a node in order to spontaneously cause other nodes to update an entry in their ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ae94677a2a5f3698276027c7475f6ca05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae94677a2a5f3698276027c7475f6ca05">&#9670;&nbsp;</a></span>etharp_cleanup_netif()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void etharp_cleanup_netif </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Remove all ARP table entries of the specified netif.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>points to a network interface </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0f8ca87c5472fa165763c8c38b76174c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f8ca87c5472fa165763c8c38b76174c">&#9670;&nbsp;</a></span>etharp_find_addr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t etharp_find_addr </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *&#160;</td>
          <td class="paramname"><em>ipaddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structeth__addr.html">eth_addr</a> **&#160;</td>
          <td class="paramname"><em>eth_ret</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> **&#160;</td>
          <td class="paramname"><em>ip_ret</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Finds (stable) ethernet/IP address pair from ARP table using interface and IP address index. </p><dl class="section note"><dt>Note</dt><dd>the addresses in the ARP table are in network order!</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>points to interface index </td></tr>
    <tr><td class="paramname">ipaddr</td><td>points to the (network order) IP address index </td></tr>
    <tr><td class="paramname">eth_ret</td><td>points to return pointer </td></tr>
    <tr><td class="paramname">ip_ret</td><td>points to return pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>table index if found, -1 otherwise </dd></dl>

</div>
</div>
<a id="ab93df7ccb26496100d45137541e863c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab93df7ccb26496100d45137541e863c8">&#9670;&nbsp;</a></span>etharp_get_entry()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int etharp_get_entry </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> **&#160;</td>
          <td class="paramname"><em>ipaddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> **&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structeth__addr.html">eth_addr</a> **&#160;</td>
          <td class="paramname"><em>eth_ret</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Possibility to iterate over stable ARP table entries</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">i</td><td>entry number, 0 to ARP_TABLE_SIZE </td></tr>
    <tr><td class="paramname">ipaddr</td><td>return value: IP address </td></tr>
    <tr><td class="paramname">netif</td><td>return value: points to interface </td></tr>
    <tr><td class="paramname">eth_ret</td><td>return value: ETH address </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 on valid index, 0 otherwise </dd></dl>

</div>
</div>
<a id="a540a5506979693ef9ac4496db9bfa7d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a540a5506979693ef9ac4496db9bfa7d6">&#9670;&nbsp;</a></span>etharp_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void etharp_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Responds to ARP requests to us. Upon ARP replies to us, add entry to cache send out queued IP packets. Updates cache with snooped address pairs.</p>
<p>Should be called for incoming ARP packets. The pbuf in the argument is freed by this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>The ARP packet that arrived on netif. Is freed by this function. </td></tr>
    <tr><td class="paramname">netif</td><td>The lwIP network interface on which the ARP packet pbuf arrived.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free()</a> </dd></dl>

</div>
</div>
<a id="a19258c75a3778b6ed0c82f63a419502d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19258c75a3778b6ed0c82f63a419502d">&#9670;&nbsp;</a></span>etharp_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> etharp_output </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *&#160;</td>
          <td class="paramname"><em>ipaddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Resolve and fill-in Ethernet address header for outgoing IP packet.</p>
<p>For IP multicast and broadcast, corresponding Ethernet addresses are selected and the packet is transmitted on the link.</p>
<p>For unicast addresses, the packet is submitted to <a class="el" href="etharp_8c.html#ae180772e31346a0afeb707ad172dd19c">etharp_query()</a>. In case the IP address is outside the local network, the IP address of the gateway is used.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The lwIP network interface which the IP packet will be sent on. </td></tr>
    <tr><td class="paramname">q</td><td>The <a class="el" href="structpbuf.html">pbuf(s)</a> containing the IP packet to be sent. </td></tr>
    <tr><td class="paramname">ipaddr</td><td>The IP address of the packet destination.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>ERR_RTE No route to destination (no gateway to external networks), or the return type of either <a class="el" href="etharp_8c.html#ae180772e31346a0afeb707ad172dd19c">etharp_query()</a> or <a class="el" href="group__ethernet.html#gac9cad5802bfa3d885f13d2ba0f40b778">ethernet_output()</a>. </li>
</ul>
</dd></dl>

</div>
</div>
<a id="ae180772e31346a0afeb707ad172dd19c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae180772e31346a0afeb707ad172dd19c">&#9670;&nbsp;</a></span>etharp_query()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> etharp_query </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *&#160;</td>
          <td class="paramname"><em>ipaddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an ARP request for the given IP address and/or queue a packet.</p>
<p>If the IP address was not yet in the cache, a pending ARP cache entry is added and an ARP request is sent for the given address. The packet is queued on this entry.</p>
<p>If the IP address was already pending in the cache, a new ARP request is sent for the given address. The packet is queued on this entry.</p>
<p>If the IP address was already stable in the cache, and a packet is given, it is directly sent and no ARP request is sent out.</p>
<p>If the IP address was already stable in the cache, and no packet is given, an ARP request is sent out.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>The lwIP network interface on which ipaddr must be queried for. </td></tr>
    <tr><td class="paramname">ipaddr</td><td>The IP address to be resolved. </td></tr>
    <tr><td class="paramname">q</td><td>If non-NULL, a pbuf that must be delivered to the IP address. q is not freed by this function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>q must only be ONE packet, not a packet queue!</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>ERR_BUF Could not make room for Ethernet header.</li>
<li>ERR_MEM Hardware address unknown, and no more ARP entries available to query for address or queue the packet.</li>
<li>ERR_MEM Could not queue packet due to memory shortage.</li>
<li>ERR_RTE No route to destination (no gateway to external networks).</li>
<li>ERR_ARG Non-unicast address given, those will not appear in ARP cache. </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a3e56faced96841e615f88dd57d1b2b15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e56faced96841e615f88dd57d1b2b15">&#9670;&nbsp;</a></span>etharp_request()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> etharp_request </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>netif</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="ip4__addr_8h.html#a3d3b45daffbc15d65da236e31e621b7e">ip4_addr_t</a> *&#160;</td>
          <td class="paramname"><em>ipaddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an ARP request packet asking for ipaddr.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">netif</td><td>the lwip network interface on which to send the request </td></tr>
    <tr><td class="paramname">ipaddr</td><td>the IP address for which to ask </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if the request has been sent ERR_MEM if the ARP packet couldn't be allocated any other err_t on failure </dd></dl>

</div>
</div>
<a id="a654f4dad71f7e2bc4820094648f37a26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a654f4dad71f7e2bc4820094648f37a26">&#9670;&nbsp;</a></span>etharp_tmr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void etharp_tmr </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears expired entries in the ARP table.</p>
<p>This function should be called every ARP_TMR_INTERVAL milliseconds (1 second), in order to expire entries in the ARP table. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b0856f6b0d80ccb263b2f415c91f9e17.html">include</a></li><li class="navelem"><a class="el" href="dir_4e6b3cf33a61b6caac9c8ac30c866f37.html">lwip</a></li><li class="navelem"><a class="el" href="lwip_2etharp_8h.html">etharp.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
